package MOLE;

/** 
 Class1 ��ժҪ˵����
*/
public class Drive
{
	public static native int GetDiskFreeSpaceEx(String lpRootPathName, tangible.RefObject<Long> lpFreeBytesAvailable, tangible.RefObject<Long> lpTotalNumberOfBytes, tangible.RefObject<Long> lpTotalNumberOfFreeBytes);
	static
	{
		System.loadLibrary("kernel32.dll");
	}

	/** 
	 Ӧ�ó��������ڵ㡣
	*/

	public static String GetFreeSpace(String Diskname)
	{
			long a,b,c = 0;
			tangible.RefObject<Long> tempRef_a = new tangible.RefObject<Long>(a);
			tangible.RefObject<Long> tempRef_b = new tangible.RefObject<Long>(b);
			tangible.RefObject<Long> tempRef_c = new tangible.RefObject<Long>(c);
			GetDiskFreeSpaceEx(Diskname + ":\\", tempRef_a, tempRef_b, tempRef_c);
			a = tempRef_a.argValue;
			b = tempRef_b.argValue;
			c = tempRef_c.argValue;
			String s = Diskname + ": free space " + (Long.parseLong(String.valueOf(a)) / 1024 / 1024).toString() + "/" + (Long.parseLong(String.valueOf(b)) / 1024 / 1024).toString() + "  Mbyte<BR>";

			/**s+="<br>D�̵�ǰ���ÿռ� " + (long.Parse(c.ToString())/1024/1024).ToString() + " Mbyte"; 
			*/
			return s;

	}
}